<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    // 住房公积金 = 税前工资 * 0.1 *2 
    var wages = parseFloat(prompt('请输入税前工资', '4000'));
    var fund = wages * 0.1 * 2;
    alert('您的住房公积金为：' + fund); // 如工资4000 公积金 800
  </script>
</body>

</html>